<?php

namespace app\index\dao;

use app\common\model\CustomPush;
use ShidianUtil\Thinkphp\Dao\DaoTrait;

/**
 * CustomPushDao 数据访问对象
 * Class CustomPushDao
 * @package app\index\dao
 * @method CustomPush findByPK(?int $id, $field = true)
 * @method \think\Collection selectAll(?int $page, ?int $page_size, $field = true)
 * @method CustomPush insertActive(array $params, array $allow_field = [])
 * @method CustomPush updateActive(CustomPush $model, array $params, array $allow_field = [])
 * @method CustomPush findAndUpdateActive(int $id, array $params, array $allow_field = [])
 * @method CustomPush updateActiveByClosure(\Closure $closure, array $params, array $allow_field = [])
 * @method void deleteModel(CustomPush $model)
 * @method void deleteById(int|array|\Closure $id, bool $force = false)
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037579
 * @link https://www.kancloud.cn/manual/think-orm/1257998
 * @link https://www.kancloud.cn/thinkphp/master-database-and-model/265551
 */
class CustomPushDao
{
    use DaoTrait;

    /**
     * @var CustomPush
     */
    private $baseModel;

    /**
     * CustomPushDao constructor.
     */
    public function __construct()
    {
        $this->baseModel = CustomPush::class;
    }

    public function findByMemberId($memberId): ?CustomPush
    {
        return CustomPush::where('memberId', $memberId)
            ->find();
    }
}
